<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>批量导出</title>
<style type="text/css">
*{
margin: 0px;
padding: 0px;
}
#all_move{
height:25px;
width: 45px;
color:white;
border: solid 1px #FF0000;
background-color: #FF0000;
}
#all_middle_move{
height:20px;
width: 30px;
color:white;
border: solid 1px #FF0000;
background-color: #FF0000;
}
#all_left_move{
height:25px;
width: 45px;
color:white;
border: solid 1px #FF0000;
background-color: #FF0000;
}
#left_move{
height:20px;
width: 30px;
color:white;
border: solid 1px #FF0000;
background-color: #FF0000;
}
p  .button {
	 cursor: pointer;
}
.div_true{
   width: 45px;
   height:20px;
   line-height:20px;
   font-size:12px;
   text-align:center;
   border: solid 1px red;
   color: white;
   background-color: #000;
   float: right;
   cursor: pointer;
}
</style>
</head>
<body>
<div style="width: 1000px; margin: 50px auto;">
		<table width="100%">
			<tr>
				<td>
					<div class="main-div" style="background-color: white;">

						<h3>
							<center>商品数据批量导出</center>
						</h3>
					
						<select id="select_cate" >
							<option >选择种类</option>
						</select>
		
					</div>
				</td>
			</tr>

			<tr>
				<td width="42%"><strong>导出条件</strong> <select
					name="src_goods_lists" id="src_goods_lists" size="14"
					style="width: 100%" multiple="true">
				</select></td>
				<td rowspan="2" width="15%" style="text-align: center;">
					<p>
						<input type="button" value=">>" id="all_move" class="button" />
					</p>
					<br/>
					<p>
						<input type="button" value=">" id="all_middle_move" class="button" />
					</p>
					<br/>
					<p>
						<input type="button" value="<" id="left_move" class="button" />
					</p>
					<br/>
					<p>
						<input type="button" value="<<" id="all_left_move" class="button" />
					</p>
				</td>
				<td width="42%"><select name="dst_goods_lists"
					id="dst_goods_lists" size="14" style="width: 100%" multiple="true">
				</select></td>
			</tr>


		</table>
	<div style="width:300px;">
	<br/>
		<strong>数据格式</strong>
		<select name="data_format" id="data_format">
			<option value="ecshop">导出到Excel数据格式</option>
		</select>
		<div id="on_true" class="div_true" >确定</div>
		<p><c:forEach items="${tip}"><a href="file://localhost/e:\\pldrxkxxmb.xls">文件路径为：${tip }</a></c:forEach></p>
	</div>
	</div>
		<script type="text/javascript" src="../js/jquery-3.1.0.js"></script>
	<script type="text/javascript">
	$(function(){
		var str;
		$.getJSON("../CategoryServlet?method=quaryAllCaregoryName", {},
			function(data) {
			$.each(data,function(index,element){
				$("#select_cate").append(
						"<option>" + element.catname + "</option>"
						);
			});
		
		});
		$("#select_cate").change(function(){
		 	var value=$(this).val();
		 		$("#src_goods_lists").append(
						"<option>" + value + "</option>"
						);
		})
		$("#all_middle_move").click(function(){
			
			  $("#dst_goods_lists").append($("#src_goods_lists option:selected"));
			
		})
		$("#left_move").click(function(){
            $("#src_goods_lists").append($("#dst_goods_lists option:selected"));
        });
        
        $("#all_move").click(function(){
            $("#dst_goods_lists").append($("#src_goods_lists option"));
        });
        
        $("#all_left_move").click(function(){
            $("#src_goods_lists").append($("#dst_goods_lists option"));
        });
        $("#on_true").click(function(){
       var catname=$("#dst_goods_lists").val();
      
     	$.getJSON("../CategoryServlet?method=quaryNameToGoods&catname="+catname,{},
        function(data){
     		$("#rightdiv").load("../yf/dataimport.jsp");
       })
        })
        
		
		
	})
	</script>
</body>
</html>